package com.shop.entity;

import java.util.Arrays;
import java.util.Objects;

public class PayMessage {
    private int o_id;
    private String[] g_names;
    private String[] g_datas;
    private double o_total;

    public PayMessage() {
    }

    public PayMessage(int o_id, String[] g_names, String[] g_datas, double o_total) {
        this.o_id = o_id;
        this.g_names = g_names;
        this.g_datas = g_datas;
        this.o_total = o_total;
    }

    public int getO_id() {
        return o_id;
    }

    public void setO_id(int o_id) {
        this.o_id = o_id;
    }

    public String[] getG_names() {
        return g_names;
    }

    public void setG_names(String[] g_names) {
        this.g_names = g_names;
    }

    public String[] getG_datas() {
        return g_datas;
    }

    public void setG_datas(String[] g_datas) {
        this.g_datas = g_datas;
    }

    public double getO_total() {
        return o_total;
    }

    public void setO_total(double o_total) {
        this.o_total = o_total;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PayMessage that = (PayMessage) o;
        return o_id == that.o_id &&
                Double.compare(that.o_total, o_total) == 0 &&
                Arrays.equals(g_names, that.g_names) &&
                Arrays.equals(g_datas, that.g_datas);
    }

    @Override
    public int hashCode() {
        int result = Objects.hash(o_id, o_total);
        result = 31 * result + Arrays.hashCode(g_names);
        result = 31 * result + Arrays.hashCode(g_datas);
        return result;
    }

    @Override
    public String toString() {
        return "PayMessage{" +
                "o_id=" + o_id +
                ", g_names=" + Arrays.toString(g_names) +
                ", g_datas=" + Arrays.toString(g_datas) +
                ", o_total=" + o_total +
                '}';
    }
}
